API Documentation
Public Member Functions | List of all members
nkAstraeus::BlurComplexEffect Class Referencefinal

A blurring effect. More...

Inheritance diagram for nkAstraeus::BlurComplexEffect:
nkAstraeus::ComplexEffect

Public Member Functions

 BlurComplexEffect (nkMemory::StringView name)
 
 ~BlurComplexEffect ()
 
virtual COMPLEX_EFFECT_TYPE getType () const override
 
nkGraphics::TexturegetSourceTexture () const
 
nkGraphics::TexturegetOutputTexture () const
 
unsigned int getKernelRadius () const
 
bool getAlphaEncodesBlurPlanes () const
 
bool getPreserveAlpha () const
 
void setSourceTexture (nkGraphics::Texture *value)
 
void setKernelRadius (unsigned int value)
 
void setAlphaEncodesBlurPlanes (bool value)
 
void setPreserveAlpha (bool value)
 
virtual bool load () override
 
virtual void unload () override
 
- Public Member Functions inherited from nkAstraeus::ComplexEffect
 ComplexEffect (nkMemory::StringView name)
 
virtual ~ComplexEffect ()
 
nkMemory::StringView getName () const
 
nkGraphics::CompositorNodegetCompositorNode () const
 
void setName (const nkMemory::StringView &value)
 
void setCompositorNode (nkGraphics::CompositorNode *value)
 

Detailed Description

A blurring effect.

This effect will blur the source texture, given provided parameters.

Constructor & Destructor Documentation

◆ BlurComplexEffect()

nkAstraeus::BlurComplexEffect::BlurComplexEffect ( nkMemory::StringView  name)

Default constructor. See ComplexEffectManager::createOrRetrieve().

Parameters
nameThe name of the effect.

◆ ~BlurComplexEffect()

nkAstraeus::BlurComplexEffect::~BlurComplexEffect ( )

Default destructor. See ComplexEffectManager::erase().

Member Function Documentation

◆ getType()

virtual COMPLEX_EFFECT_TYPE nkAstraeus::BlurComplexEffect::getType ( ) const
overridevirtual
Returns
The effect type, COMPLEX_EFFECT_TYPE::BLUR in this case.

Implements nkAstraeus::ComplexEffect.

◆ getSourceTexture()

nkGraphics::Texture* nkAstraeus::BlurComplexEffect::getSourceTexture ( ) const
Returns
The source texture used by the effect.

◆ getOutputTexture()

nkGraphics::Texture* nkAstraeus::BlurComplexEffect::getOutputTexture ( ) const
Returns
The texture the effect will finally output to.
Remarks
This texture is tied to the lifetime of the ComplexEffect it is linked to. It will be usable as long as the effect is alive and won't change even after loading operations.

◆ getKernelRadius()

unsigned int nkAstraeus::BlurComplexEffect::getKernelRadius ( ) const
Returns
The kernel radius used.

◆ getAlphaEncodesBlurPlanes()

bool nkAstraeus::BlurComplexEffect::getAlphaEncodesBlurPlanes ( ) const
Returns
Whether the effect considers alpha as encoding blur planes (true) or not (false).

◆ getPreserveAlpha()

bool nkAstraeus::BlurComplexEffect::getPreserveAlpha ( ) const
Returns
Whether the effect will preserve the alpha and blur it like any other channel (true), or not (false).

◆ setSourceTexture()

void nkAstraeus::BlurComplexEffect::setSourceTexture ( nkGraphics::Texture value)

Sets the texture to use as input to the effect.

Parameters
valueThe texture to use as input.
Remarks
This parameter can be updated on an already loaded effect.

◆ setKernelRadius()

void nkAstraeus::BlurComplexEffect::setKernelRadius ( unsigned int  value)

Sets the kernel radius for the blurring operation. Defaults to 5.

Parameters
valueThe radius, in pixel, for the blurring operation. For instance, a radius of 1 will blur using 1 pixel around the reference pixel.
Remarks
This parameter requires an effect reload if updated on an already loaded one.

◆ setAlphaEncodesBlurPlanes()

void nkAstraeus::BlurComplexEffect::setAlphaEncodesBlurPlanes ( bool  value)

Sets whether the effect should consider alpha as encoding blurring planes. Blurring planes can be used to isolate and blur sub-parts of an image, independently. For instance, having a part of an image with an alpha of 0.2, and another one of 0.3, will blur together the pixels with alpha 0.2, excluding the 0.3 pixels, and vice versa. Defaults to false.

Parameters
valueWhether the alpha encodes blurring planes (true) or not (false).
Remarks
This parameter needs the effect to be reloaded if updated on a loaded effect.

◆ setPreserveAlpha()

void nkAstraeus::BlurComplexEffect::setPreserveAlpha ( bool  value)

Sets whether the alpha channel should be preserved while blurring, or not. A preserved alpha channel will either get blurred like any other color channel if not encoding a plane, either keep the plane information after blurring. Defaults to false. If not preserved, the effect will overwrite any alpha information with 1 in the output texture.

Parameters
valueWhether the alpha should be preserved (true) or not (false).
Remarks
This parameters needs the effect to be reloaded if updated on a loaded effect.

◆ load()

virtual bool nkAstraeus::BlurComplexEffect::load ( )
overridevirtual

◆ unload()

virtual void nkAstraeus::BlurComplexEffect::unload ( )
overridevirtual

The documentation for this class was generated from the following file: